package com.ad.pet.app.main.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by SEELE on 2019/7/2.
 */
public  class Time2TipsVpAdapter extends PagerAdapter {
    List<View> mViews;

    public Time2TipsVpAdapter(List<View> vpPackets) {
        mViews = vpPackets;
    }

    @Override
    public int getCount() {
        return mViews.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {

        return view == object;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(mViews.get(position));
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {

        container.addView(mViews.get(position));
        return (mViews.get(position));
    }
}
